import {
  IsNotEmpty,
  IsString,
  MinLength,
  MaxLength,
  IsOptional,
  IsDate,
  Min,
  Max,
  ArrayNotEmpty,
  IsInt,
  IsNumber,
} from 'class-validator';
import { ApiErrorCode } from '../../common/enums/api-error-code.enum';
import { plainToClass, Exclude, Type } from 'class-transformer';

export class LuckArr {
  @IsOptional()
  @Type(() => Number)
  @IsNotEmpty({ message: '数量不能为空' })
  readonly number: number;

  @IsOptional()
  readonly specifications: string;
}

export class createOrderDto {
  @Type(() => Number)
  @IsNotEmpty({ message: '金额不能为空' })
  readonly money: number;

  @Type(() => Number)
  @IsNotEmpty({ message: '商品不能为空' })
  readonly goodsId: number;
}

export class getListDto {
  @Type(() => Number)
  @IsNotEmpty({ message: 'page不能为空' })
  readonly page: number;

  @IsOptional()
  @Type(() => Number)
  @IsNotEmpty({ message: 'pageSize不能为空' })
  readonly pageSize: number;

  @IsOptional()
  @Type(() => Number)
  readonly orderClass: number;
}
